package com.hsc.www.exchangeType.topic;

import com.alibaba.fastjson.JSONObject;
import com.hsc.www.User;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class UserReceiver {

    @RabbitListener(queues= Config.CAT_QUEUE)
    public void receive1(User user) {
        System.out.println("接收：queueName="+ Config.CAT_QUEUE+"   "+ JSONObject.toJSONString(user));
    }

    @RabbitListener(queues= Config.CAT1_QUEUE)
    public void receive2(User user) {
        System.out.println("接收：queueName="+ Config.CAT1_QUEUE+"   "+ JSONObject.toJSONString(user));
    }

    @RabbitListener(queues= Config.CAT2_QUEUE)
    public void receive3(User user) {
        System.out.println("接收：queueName="+ Config.CAT2_QUEUE+"   "+ JSONObject.toJSONString(user));
    }

}
